﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VswService_V7.OPC.DB;
using VswService_V7.Utility;

namespace VswService_V7.DataBase.Tables
{
    public class STRIP_LHT3
    {
        #region  field
        public static readonly string tableName = "STRIP_LHT3";
        public static readonly string fd_stripNo = "STRIP_NO";
        public static readonly string fd_dtj = "DTJ";
        public static readonly string fd_updateTime = "UPDATE_TIME";
        public static readonly string fd_pow = "POWER";
        public static readonly string fd_frq = "FREQ";
        public static readonly string fd_temp = "TEMP";
        public static readonly string fd_curr = "CURT";
        public static readonly string fd_vot = "VOLT";
        #endregion

        /// <summary>
        /// Create the LHT3 part of the insert all into statement, only return sql string without catch
        /// </summary>
        /// <param name="stripNo"></param>
        /// <param name="position"></param>
        /// <param name="pd"></param>
        /// <returns></returns>
        public static string CreatInsertAllsql(string stripNo, string position, ProcessData pd)
        {
            string sql = string.Format("into {0}" +
                        "({1},{2},{3},{4}," +
                        "{5},{6},{7},{8}) " +
                        "values('{9}','{10}','{11}','{12}'," +
                        "'{13}','{14}','{15}','{16}') ",
                        tableName,
                        fd_stripNo, fd_dtj, fd_updateTime, fd_pow,
                        fd_frq, fd_temp, fd_curr, fd_vot,
                        stripNo, position, pd.updateTime.ToString(Formats.GetLongFormat()), pd.LHT3_Power,
                        pd.LHT3_Freq, pd.LHT3_Tempe, pd.LHT3_Curt, pd.LHT3_Volt);
            return sql;
        }
    }
}
